<%= javascript_include_tag 'jquery.tools.min' %>
<%= javascript_include_tag 'overlay' %>
<%= render :partial =>'/store/toolbar'%>
<div id="content_container">
  <div class="hot_container" >
    <div class="title"><span class='title_content'>用户列表</span></div>
    <table class="admin"  cellpadding="0" cellspacing="0" >
      <thead>
        <tr>
          <th>用户名</th>
          <th>email</th>
          <th>角色</th>
          <th>状态</th>
          <th colspan="2"></th>
        </tr>
      </thead>
      <% for user in @users %>
        <tr>
          <td>
            <%= link_to user.login,user,:rel=>"#overlay"%>
          </td>
          <td><%= user.email %></td>
          <td><%= user.roles.map{|r| r.name}.join(",") %></td>
          <td><%= user.agent_status ? format_user_status(user.agent_status):"<span style='color:green;'>正常</span>"  %></td>
          <td style="width:6em;" class="action_link"><%= link_to '编辑角色',"/users/list_role/#{user.id}",:class=>"action_edit" %></td>

          <td style="width:4em;" class="action_link"><%= link_to '删除', user, :confirm => '确定删除?', :method => :delete,:class=>"action_delete" %></td>
        </tr>
      <% end %>
    </table>
    <%= will_paginate @users,:prev_label => '«上一页',:next_label => '下一页»' %>
  </div>
</div>